//
//  SLHomeViewController.swift
//  SLBlog
//
//  Created by 盼 on 2017/11/23.
//  Copyright © 2017年 pan. All rights reserved.
//

import UIKit

class SLHomeViewController: SLBaseViewController {

    @objc func pushToFriendsPage()
    {
        let demoVC = SLDemoViewController()
        navigationController?.pushViewController(demoVC, animated: true)
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        navigationItem.title = "首页";
        // Do any additional setup after loading the view.
        
        let urlStr = "https://api.weibo.com/2/statuses/home_timeline.json"
        let paras = ["access_token":"2.00V9PLvC0wFgu7badc7cf0c7FqwhfD"];
        
//        SLHttpClient.shared.request_2(method: .Get, urlStr: urlStr, params: paras as [String : AnyObject], success: { (task, json) in
//
//            print(json ?? "")
//
//        }) { (task, error) in
//
//            print(error)
//        }
        
        SLHttpClient.shared.requestStatusList(success: { (task, list) in
            
            print(list ?? "")
        }) { (task, error) in
            
            print(error)
        }
        
    }
}


extension SLHomeViewController
{
  @objc override func setupUI() {
        super.setupUI()
        
        navigationItem.leftBarButtonItem = UIBarButtonItem.init(title: "好友", target: self, action: #selector(pushToFriendsPage))
    }
}
